Editing tools

Introduction

There are two types of edition. Firstly, there is the graphic edition of elements which creates, modifies and deletes graphic elements and secondly, the alphanumeric edition of elements which creates, modifies and deletes data associated with the elements.


Graphic editing

Introduction

gvSIG's CAD extension can make complex drawings from basic elements, such as lines, circles or polygons.

Features can be duplicated or modified as you wish by using actions such as copying or rotating.

To carry out these tasks, we need to know what type of layer is being edited. Once we know the type of layer, we can see which tasks can be carried out.

When the “Start edition” option is selected, the edition tool bar buttons appear. Only the buttons which can be used in the layer being edited are active. Thus, for example, if a points layer is being edited, the selection, move and point insertion tools are enabled

introduccion-y-area-de-dibujo.img/barraHerramientasEdicion_es.png

whilst if, for example, the layer is a line layer, all the tools are enabled except the point insertion tool.

introduccion-y-area-de-dibujo.img/barraHerramientasEdicion_es.png

Another tool which appears when an editing session is started is the command console or message and command area, located at the bottom of the graphic area. This tool allows you to input commands via the computer keyboard. These are then carried out in the graphic area.


The graphic area

introduccion-y-area-de-dibujo-en.img/pantallaCompletaConsola_en.png

If you select the “Layer” menu option then go to “Start edition”, the application window shows the following areas.

Menu bar: Menus with which you can access the application’s functions. The contents will change according to the situation, thus, for example, the "Geometry" menu will only appear when a layer is being edited.

Tool bar: Bar which shows the drawing command icons.

Graphic area: This takes up the majority of the display and is where the layer which is being edited is shown.

Command console: This is where the editor’s PROMPT is located (active line of the console). This means that the programme is ready to receive commands. When a command is input, the corresponding process is run and the messages, information or parameter requests are shown.

Status bar: This shows the scale, the measuring units, the absolute coordinates of the cursor position (X and Y) in these units and the projection.


Starting and finishing an editing session in gvSIG

Introduction

Firstly, enable the layer you wish to edit by selecting it in the ToC. Place the cursor over it and right click on the mouse. The contextual menu appears. Select the “Start edition” option.

iniciar-y-terminar-una-sesion-de-gvsig-en.img/menuComenzarEdicion_en.png

N.B.: More than one layer can be edited and you can alternate what you do with them. However, whatever you do will only take effect on the active layer. To change the layer you are working on, select it in the ToC.

When you finish your editing session, go to the “Finish edition” option in the contextual menu.

iniciar-y-terminar-una-sesion-de-gvsig-en.img/menuTerminarEdicion_en.png

N.B.: The application will create a projection of the object you are working on to help you with the graphic editing. This will allow you to get a visual idea of the obtained result. The object projection will be shown in red.

The figure shows how a projection of the figure copied in a different colour is created during the copying process. This projection allows you to specify exactly where you want to place the new object in the graphic area.

iniciar-y-terminar-una-sesion-de-edicion-en-gvsig.img/rectanguloParaCopiar_es.png

Procedures to input commands

Introduction

There are three general mechanisms for the application to run user commands. The first mechanism is to select the command by clicking on the corresponding button in the tool bar. The second option is to activate the tool by selecting it in the menu bar (normally in the “Geometry” tab) and the third and last mechanism is by inputting commands in the command console using the keyboard.


Tool bar

The edition tool bar appears when a layer is being edited. The tool bar icons will be activated according to the type of layer being edited.

procedimientos-para-entrada-de-ordenes.img/barraHerramientasEdicion2_es.png

Menu bar

When an editing session starts, a new menu called “Geometry” appears in the bar from which we can access the different tools.

procedimientos-para-entrada-de-ordenes-en.img/barraMenus_en.png

Command console
procedimientos-para-entrada-de-ordenes-en.img/consolaComandosRecortada_en.png

The commands, options, messages or parameter requests the programme runs are shown in the area called "Command console".

The bottom line of the command console is called the "line command" and shows the action the application is running. The command console area size can be increased or decreased. To modify its size, place the mouse pointer on the separation bar between the command console and the graphic area, left click on the mouse and move the bar up or down until it is situated in the required position.

When you have finished, let go of the mouse button. You can also hide the command console by clicking on the down-facing triangle situated at the top right of the console. To show the command console, click on the upward-facing triangle.

To input commands into the command console using the keyboard, write the name of the command or order and press “Enter”. Commands can be input in capital or small letters. When a command is input, a window or a set of options associated with this command appears.

For example, if the “rectangle” command is input, a window will appear in which the definition of a corner point is requested. When the point has been inserted, a second point or “C” is requested to indicate that the object will be a square.

procedimientos-para-entrada-de-ordenes-en.img/rectanguloEnConsola_en.png

Editing properties

Introduction

When a layer editing session has been started, if you right click on its name in the ToC, a contextual menu appears in which, among other things, you can access the “Edition properties” to configure them.

propiedades-de-edicion-en.img/propiedadesEdicion_en.png

Snapping

You can configure the “Snap tolerance” in the first editing page. “Snap” or “Snapping” is the process of moving an element until it coincides exactly with the coordinates of another element. If the “Snap tolerance” is 4 pixels, two elements which are the same distance or closer than 4 pixels will be joined in a common coordinate.

You can do element snapping between layers by enabling the corresponding check boxes in the “Selected” column.

You can modify the values of the "Maximum features edition cache" column to accelerate the snappings and handlers being edited. This is the maximum number of geometries you wish to work with in the cache.


Configuring the grid

If you select "Grid" in the tree on the left, this will allow you to configure the grid's properties.

The grid is a point pattern which extends over the whole of the graphic area. It is useful in that it allows you to line up objects and calculate the distance between them.

You can enable the “Show grid” and “Adjust to grid” check boxes and edit the distance between the grid points.

propiedades-de-edicion-en.img/propiedadesEdicionRejilla_en.png

When the grid is shown, the graphic area will look like this.

propiedades-de-edicion.img/rejillaVista_es.png

Flatness

You can configure “Flatness” by selecting the corresponding option in the tree on the left.

propiedades-de-edicion-en.img/propiedadesEdicionFlatness_en.png

In gvSIG, a circle or any curved geometry is made up of straight sections. The flatness number you specify will define the maximum size of these sections.


Undoing / Redoing

The command stack

The command stack is a tool which allows you to undo/redo several commands at once. It also provides information about the commands carried out, such as the name and time they were carried out.

The command stack can be activated in different ways.

By clicking on the tool bar icon shown below.

deshacer-rehacer.img/botonPilaDeComandos_es.png

By selecting the menu bar option "File" then going to "Command stack". The command stack saves all the commands given on the layer being edited since the last time it was saved.

deshacer-rehacer-en.img/pilaDeComandos_en.png

You can select the commands you wish to undo in the slider control. You can move the slider control up or down until you have positioned it in the order in which you wish to continue working.

deshacer-rehacer-en.img/pilaDeComandosDeshacer_en.png

You must remember that you cannot undo one specific command, you have to undo all the commands given up to that point, i.e. we have to go to the last step we wish to keep and continue editing from this point. For example, let us suppose that we take eleven steps and when we reach the eleventh step, we realise that step number six is incorrect. We cannot simply go to step 6 and cancel it, we have to undo the eleventh, tenth, ninth steps, etc. until we get to the fifth one. The advantage of using the command stack is that we can undo all the changes at once without having to undo them one by one. In addition, we know which steps we are undoing.


Undo/Redo

You can access Undo/Redo from the edition tool bar by clicking on the corresponding icon.

deshacer-rehacer.img/botonDeshacerRehacer_es.png

The button with the left facing arrow allows you to undo the last step. The button with the right facing arrow allows you to redo the last step you have undone.


Editing commands

Introduction

Editing commands are the set of orders used to edit or modify a drawing. More specifically, they cover all the processes and mechanisms required to modify and work with what has already been drawn.

gvSIG uses three different ways to run these commands.


Copying

This makes a copy of the objects you have selected. The elements copied will keep the same size and orientation as the originals. To access this tool, click on the “Copy” button in the tool bar

acciones-posibles-en-una-sesion-de-edicion.img/botonCopiar_es.png

or go to the “Geometry” menu bar, then to "Modify" and "Copy".

acciones-posibles-en-una-sesion-de-edicion-en.img/menuCopiar_en.png

The copying process is basically the same as the move process but the source objects do not move from their initial positions. New objects are created in the new location which are identical to the originals in size, shape and in the distance between them.

To make a copy, when the objects to be copied have been designated, two points need to indicated, the base point and the move point.

As with the rest of the tools, a projection of these objects will be shown in the view to specify the view location the copied objects are to be inserted in.

When the copied objects are situated in their location, click on the view again to set their position.

To copy objects from the command console, write the command "copy" when you have selected the objects you wish to copy, input the first move point and then the second point.

For example, when the command and the first move point have been input (30,40), the projection of the figure being copied appears. Input the second move point, (60, 40 in the example), and the new identical element will appear in the defined location.

acciones-posibles-en-una-sesion-de-edicion-en.img/copiarPoligonoVentanaCompleta_en.png

Symmetry

This tool allows you to make a drawing which is symmetrical to the selected one. You can access this tool by clicking on the “Symmetry” button in the tool bar

acciones-posibles-en-una-sesion-de-edicion.img/botonSimetria_es.png

or by going to the “Geometry” menu bar, then to “Modify” and “Symmetry”.

acciones-posibles-en-una-sesion-de-edicion-en.img/menuSimetria_en.png

To obtain a symmetrical drawing in gvSIG, firstly select the element and then select the “Symmetry” option. Then, click on the display graphic area to insert the first symmetry axis point. gvSIG will then create a red projection of a figure which is symmetrical to the selected figure. You can then input the second point the symmetry axis will pass through by clicking on the graphic area again.

acciones-posibles-en-una-sesion-de-edicion.img/poligonoEnSimetria_es.png

If you wish to run the tool from the command line, firstly write the command “symmetry”.

Input the first point the symmetry axis will pass through and press “Enter”. The console will then ask you to input a second point this axis has to pass through.

Input the point and press “Enter” again.

The console will ask you if you wish to keep the source object, write “Y” if you wish to keep it and “N” if you do not.

acciones-posibles-en-una-sesion-de-edicion-en.img/simetriaPorConsola_en.png

Rotating

You can use this tool to rotate the selected objects by taking a base point as the centre. You can activate this tool by clicking on the “Rotate” button in the edition tool bar

acciones-posibles-en-una-sesion-de-edicion.img/botonRotar_es.png

or by going to the "Geometry" menu bar, then to “Modify” and “Rotate”.

acciones-posibles-en-una-sesion-de-edicion-en.img/menuRotar_en.png

To rotate an element, first place the base point by clicking on the graphic area. Move the mouse, with the help of the projection that gvSIG uses to the effect, until the new position has been established.

Left click on the mouse in the view to define this point.

If you wish to rotate an element from the command console, select the object to be rotated, write the command “rotate” and input the first move point.

Then input how much you wish to rotate it in sexagesimal degrees.

The object will be rotated clockwise if you write a negative angle and anti-clockwise if you write a positive angle.

acciones-posibles-en-una-sesion-de-edicion-en.img/rotarEnConsola_en.png

Moving Elements

This tool allows you to move the selected objects from one point to another in the view by indicating a move vector. You can use this tool by selecting it from the tool bar by clicking on the "Move" button

acciones-posibles-en-una-sesion-de-edicion.img/botonDesplazamiento_es.png

or by going to the “Geometry” menu bar, then to “Modify” and "Move".

acciones-posibles-en-una-sesion-de-edicion-en.img/menuDesplazamiento_en.png

If you wish to move an element, select the object you wish to move and then activate the “Move” option. Click on the graphic area to define the move point.

gvSIG will create a red projection of the elements it is moving which can be used as a guide to position them in their new location.

acciones-posibles-en-una-sesion-de-edicion.img/poligonoDesplazado_es.png

When the element is located in the desired position, left click on the mouse again to define the new position.

To use the “move” command from the command console, write the command “move”. The console will show a message requesting a move point. Input the point.

acciones-posibles-en-una-sesion-de-edicion-en.img/desplazamientoEnConsola_en.png

Then input the second move point. Press “Enter” and the object will move to its new position.


Selecting
Simple selection

To select one of the drawn objects in the layer we are editing, click on the "Select" button in the tool bar,

acciones-posibles-en-una-sesion-de-edicion.img/botonSeleccionSimple_es.png

or go to the “Geometry” menu bar and then to “Select”.

acciones-posibles-en-una-sesion-de-edicion-en.img/menuSeleccionSimpYcomplej_en.png

Then click on the object you wish to select.


Complex selection

You can access this button in the tool bar,

acciones-posibles-en-una-sesion-de-edicion.img/botonSeleccionCompleja_es.png

or by going to the “Geometry” menu bar then to “Complex selection”.

When the “Complex selection” tool has been selected, right click on the mouse in the graphic area. The following contextual menu will appear.

acciones-posibles-en-una-sesion-de-edicion-en.img/seleccionarDentroCircunferencia_en.png

Click on the option you wish to use to select the elements.

If you use the “Inside circle” option you can delimit a circle so that the elements you wish to select remain inside this area.

acciones-posibles-en-una-sesion-de-edicion.img/circunferenciaSeleccionando_es.png

The selection result corresponds to the following image.

acciones-posibles-en-una-sesion-de-edicion.img/puntosSeleccionadosXcircunferencia_es.png

You can also write the “select” and “complex selection” commands in the command console. Command: “select” Write the command “select” in the command console.

When a message appears in the command console requesting you to add the selection point, input the coordinates of the object you wish to select.

If there is an object in the defined coordinates, it will be selected.

acciones-posibles-en-una-sesion-de-edicion-en.img/ordenConsolaSeleccionar_en.png

Command: “complex selection” Write the command “complex selection” in the command console and when the selection options appear, write the desired option.

The options are shown with their names, and in square brackets ([]) the text you need to input in the command console to use the option.

acciones-posibles-en-una-sesion-de-edicion-en.img/ordenConsolaSeleccionCompleja_en.png

If, for example, you wish to select the features that are in a polygon area, you need to write “complex selection” in the command console, press “Enter” and then select the “IP” option.

This allows us to indicate the coordinates of the vertices which will make up the polygon (when the coordinates of each of the vertices are indicated a polygon is drawn in the drawing window) and when it is finished, the elements which are inside it are selected so you can work on them.

The following image shows how a selection option is input.

acciones-posibles-en-una-sesion-de-edicion-en.img/ordenConsolaSeleccionComplejaIP_en.png

The following figure shows the definition of the selection polygon in the graphic area.

acciones-posibles-en-una-sesion-de-edicion-en.img/seleccionComplejaEnPantalla_en.png

When the polygon is finished, the elements contained inside it will be selected so you can work on them.

Selection options
  • Outside rectangle [OR]: This allows you to delimit a rectangular area and select the elements which lie outside this area.
  • Inside polygon [IP]: This allows you to draw a polygon area and select the elements located inside this area.
  • Intersects with/Contains polygon [CP]: This allows you to draw a polygon area and select all the elements located inside it or which intersect with its perimeter.
  • Outside polygon [OP]: This allows you to delimit a polygon area and select the elements which lie outside it.
  • Inside circle [IC]: This allows you to delimit a circle and select all the elements located inside this area.
  • Intersects with/Contains circle [CC]: This allows you to delimit a circle and select all the elements located inside it or which intersect with its perimeter.
  • Outside circle [OC]: This allows you to delimit a circle and select the elements which lie outside it.
  • Select all: This selects all the elements contained in the layer regardless of where they lie in it.

Editing vertex

This tool allows you to go through the vertices of the selected objects easily and carry out other actions, such as adding a new vertex or deleting the vertex which is being edited.

To access this tool, click on the “Edit vertex” button in the tool bar.

acciones-posibles-en-una-sesion-de-edicion.img/botonEditarertice_es.png

You can also access the tool by going to the “Geometry” menu bar then to “Modify” and “Edit vertex”.

acciones-posibles-en-una-sesion-de-edicion.img/menuEditarVertice_es.png

To edit the vertices of a figure, select the figure and click on the “Edit vertex” button in the tool bar.

A red pointer appears in one of the vertices of the figure you are editing.

acciones-posibles-en-una-sesion-de-edicion.img/poligonoEditarVertice_es.png

If you right click on the mouse, a menu will appear from which you can select the actions you wish to carry out.

If you click on the “Next” option, the cursor will move to the next vertex of the selected object.

acciones-posibles-en-una-sesion-de-edicion.img/poligonoEditarVerticeSiguiente_es.png

You can also access this tool from the command console. To do so, write the command: EDIT VERTEX.

If, for example, you wish to go through the vertices of an element, write the command and input the parameter “S” (next).

To go to the previous vertex, write the parameter “A”.

To delete a vertex write the parameter “E” and press “Enter”.

To add (insert) a vertex, write the parameter “I” and press “Enter”.

The X and Y coordinates of the new vertex will then be requested (remember that these coordinates should belong to the polygon perimeter).

Input the data in the console and press “Enter”.

A new vertex will be created in the figure.

acciones-posibles-en-una-sesion-de-edicion.img/consolaEditarVertice_es.png

Internal polygon

This tool allows you to create a polygonal feature inside an existing feature.

You can access this tool by going to the "Geometry" menu then to "Modify" and "Internal polygon”

acciones-posibles-en-una-sesion-de-edicion.img/menuPoligonoInterno_es.png

or from the following tool bar button:

acciones-posibles-en-una-sesion-de-edicion.img/botonPoligonoInterno_es.png

You can create an internal polygon, either graphically or from the gvSIG command console.

If you wish to create the polygon graphically, the polygon element layer must be in editing mode and you must select the polygon on which you wish to use the selected tool.

Activate the "Internal polygon" tool and place the cursor where you wish to insert the first vertex.

acciones-posibles-en-una-sesion-de-edicion.img/poligonoInternoIncicio_es.png

Then insert the vertices of the polygonal feature you wish to create. When you do not wish to insert any more vertices, right click on the mouse and select “End” from the contextual menu that appears.

acciones-posibles-en-una-sesion-de-edicion.img/poligonoInterno2paso_es.png

The corresponding internal polygon is created.

acciones-posibles-en-una-sesion-de-edicion.img/poligonoInternoFinal_es.png

You can also use this tool from the command console. To do so, write the command “internal polygon” in the command line.

Then input the X and Y coordinates of the points which will correspond to the vertices of the new polygonal feature. When you have finished, write “e” to close the new internal polygon you have created.

acciones-posibles-en-una-sesion-de-edicion.img/poligonoInternoConsola_es.png

Scaling

This command can be used to modify the size of the selected objects. Select this tool by clicking on the “Scale” button in the tool bar

acciones-posibles-en-una-sesion-de-edicion.img/botonEscalar_es.png

or by going to the "Geometry" menu bar then to "Modify" and “Scale”.

acciones-posibles-en-una-sesion-de-edicion-en.img/menuEscalar_en.png

There are two ways of scaling, either by indicating a scale factor or by reference. Scaling by “Scale factor” To graphically scale elements using a scale factor, select the objects whose size you wish to modify, activate the scale tool and set the base point. The application will create an image which will give you a reference point about the size of the objects you are modifying.

As you get closer to the point you have set as the base point, the elements you are working with will get smaller, whilst the farther away you move, the bigger they will get.

When the objects are the desired size, click on the drawing window again. The same scale factor is applied for both the X and Y coordinates.

acciones-posibles-en-una-sesion-de-edicion-en.img/escalar_en.png

To graphically scale using the "Reference" option, select the objects and activate the “scale” command, then right click on the mouse inside the graphic area to show the tool’s contextual menu.

Select the “Reference” option. Indicate the points on the reference line and on the scale line as the messages in the command console are shown.

acciones-posibles-en-una-sesion-de-edicion-en.img/escalarPorReferenciaConsola_en.png

You can also use the “scale” command in the command console. When you have selected the objects to be scaled, write the command “scale” and then input the base point as shown in the following figure.

acciones-posibles-en-una-sesion-de-edicion-en.img/escalarDesdeConsola_en.png

To increase the size of the objects you must input a scale factor which is greater than 1.

If you wish to reduce the size of the objects, the scale factor must be between 0 and 1.

If no value is input, gvSIG will use the scale factor 2 by default.

Scaling by “Reference” If you wish to scale using the "Reference" option, select the elements you wish to scale, choose the base point, then input the letter "r" into the command console to indicate that scaling by reference will be used.

Specify the source point and the final point of the reference straight line and then input the source point and final point of the scale line.

acciones-posibles-en-una-sesion-de-edicion-en.img/escalarDesdeconsolaPorReferencia_en.png

Explode

This tool is used to split a polyline into different segments.

To split a polyline, start editing the line layer and select the polyline:

explotar_en.img/ejemplo-en.png

Polyline selection

Once the polyline has been selected, activate the explode tool to split the polyine into segments. Verify that each of the segments can be selected as a line instead of as a poyline.

explotar_en.img/Explotar_en.png

Explode button


Join geometries

The Join tool combines two or more geometries from the same polygon or line layer into a single multipolygon or multiline geometry. The tool can't be used with point layers as this would create a multipoint shape, which is already a shape-independent type.

In order to use the tool the layer must be in edit mode. Use the Edit Selection tool to select the geometries to be joined, making use of the Ctrl key to select multiple geometries.

unir-geometrias_en.img/Unir_en.png

Selecting geometries to be joined

Once the geometries have been selected click the Join icono tool to join the geometries into a single record in the table. It should be noted that the attributes of the geometry with the higher value 'Id' will be retained, i.e. the one that is drawn last.

unir-geometrias_en.img/Unir2_en.png

Example showing the result of the Join tool


Split geometries

This tool splits geometries from the same layer. To perform the division, first switch the layer to edit mode and then use the selection tool to select the geometry to be split.

The "Split geometries" icono tool can be found on the editing toolbar.

Once the geometry has been selected,

partir-geometrias_en.img/partir_en.png

Selecting the geometry

click on the Split geometries icon. In the command window at the bottom the following message appears: "Insert first point." To split the geometry, draw a line where it should be divided. This is done by inserting a series of points that define the line along which the division is performed.

partir-geometrias_en.img/partir2_en.png

Splitting the geometry

Double-click to finish digitising the line and to perform the split. Then use the selection tool to verify that the geometry has been split into different parts.

partir-geometrias_en.img/partir3_en.png

Result

The split operation results in the creation of separate records for each part in the attribute table, rather than the single record that existed prior to the split.


Matrix

The matrix command allows an item to be copied as many times as desired in a particular arrangement. The matrix can be of two types: rectangular matrix or polar matrix.

Right-click the layer you want to work with and select Start editing. Select an item, either a point, line or polygon, and then click on the Matrix tool. In the command window at the bottom of the screen the following instruction is displayed: Insert selection point. Clicking on the item opens the Matrix window.

matriz_en.img/captura-en.png

Matrix Window

Select the number of rows and columns by typing the values directly into the appropriate boxes.

The linear arrangement of the elements can be defined by typing the values manually, or by using the vector and increm icons to draw a direction vector or to define the extent of the matrix, respectively. In the second case, there are icons for defining the extent for each axis.

The matrix can be rotated by manually entering a rotation value or by clicking the increm1 icon and drawing the rotation angle in the View.

Using the values defined in the Matrix Window shown in the image above would produce the following matrix:

matriz_en.img/rectangular-en.png

Final result showing the rectangular matrix

In the case of a polar matrix enter the source of the "system", the number of elements and whether the items should be rotated as they are copied.

matriz_en.img/polar-en.png

Final result showing the polar matrix


Copy & paste geometries
Introduction

Using the copy/paste tools you can copy and paste geometries from one layer to another. These layers may be in the same view, in different views, or even in two different instances of gvSIG.


Copy & paste geometries

Links have been created to complimentary tools for copying and pasting features between vector layers of the same type.

As the mechanism used to implement this tool makes use of the system clipboard, the source and destination layers can be either in the same view, in different views, or even in different instances of the application.

Copy items between layers with the editing session active.

This tool is used to copy features selected in a vector layer to the system clipboard.

The tool can be accessed in three different ways:

Through a button on the toolbar:

instrucciones-de-uso/copy-paste_en.img/copiar_en.png

Through the Layer menu in the menu bar:

instrucciones-de-uso/copy-paste_en.img/copiar-barra-menus_en.png

Through the context menu that appears when you right-click on the active layer in the TOC:

instrucciones-de-uso/copy-paste_en.img/copiar-menu-contextual_en.png

This tool will be displayed and activated when the active layer is a vector layer with selected features.

Paste features.

This tool is used to paste to paste to an editable layer features that have previously been copied to the system clipboard.

The tool can be accessed in three different ways:

Through a button on the toolbar:

instrucciones-de-uso/copy-paste_en.img/pegar_en.png

Through the Layer menu in the menu bar:

instrucciones-de-uso/copy-paste_en.img/pegar-barra-menus_en.png

Through the context menu that appears when you right-click on the active layer in the TOC:

instrucciones-de-uso/copy-paste_en.img/pegar-menu-contextual_en.png

This tool will be displayed and activated when the active layer is a vector layer in edit mode and of the same type as the layer from which the features have been copied. When used to paste geometries from the clipboard to this editable layer, fields in the associated table will be filled if they have matching names and types.


Drawing commands (points, lines...)

Introduction

This section deals with gvSIG’s drawing commands. The rest of the commands can modify the elements but with the exception of the “copy” command, they cannot create new features and we thus require the actual drawing commands to do so.

gvSIG includes basic drawing elements, such as lines, circles or polygons, which can be used to obtain any complex drawings.

All the elements you wish to insert need one or several points to be specified so that they are correctly placed in the drawing.

Remember that the tools to insert new elements vary according to the type of layer being edited. Thus, for example, a point can only be inserted in a point-type layer and is not supported by any other type of layer.


Point

You can activate this tool by clicking on the “Point” button in the tool bar.

insertar-elementos-de-dibujo.img/botonPunto_es.png

You can also activate it by going to the “Geometry” menu bar then to “Insert” and “Point”.

insertar-elementos-de-dibujo.img/menuPunto_es.png

Inserting a coordinate point

A point can be referenced in two ways:

The coordinates can also be:

Inputting Cartesian coordinates.

Input the X and Y values separated by a comma (X,Y). The X value is the positive or negative distance, in units along the horizontal axis, the Y value is the distance in units along the vertical axis.

insertar-elementos-de-dibujo.img/puntoDesdeConsola_es.png

The values used to designate the points can be whole, decimal, positive or negative.

The absolute coordinate values are based on the source (0,0), which is the place the X and Y axes intersect. For example, the point 25,7 designates a point located 25 units away from the source on the X axis and 7 units away on the Y axis.

The relative values of the coordinates are based on the last input point. Use the relative coordinates when you know the coordinates of a point based on the previous point.

To designate a relative point, place the (@) symbol in front of the coordinates.

For example, the @1,2 coordinates determines a point 1 unit away on the X axis and 2 units away on the Y axis from the previously designated point.

Inserting polar coordinates

To input polar coordinates, indicate a distance and an angle separated by the < symbol. For example, to designate a point 5 units away from the previous one with a 45 degree angle, write @5<45. The angles increase anti-clockwise and decrease clockwise. To move anti-clockwise, indicate a negative angle. For example, the 1<315 position is the same as the 1<-45 position.

insertar-elementos-de-dibujo.img/puntoRelativoDesdeConsola_es.png

Multipoint

You can activate this tool by clicking on the “Multipoint” button in the tool bar

insertar-elementos-de-dibujo.img/botonMultipunto_es.png

or by going to the “Geometry” menu bar then to “Insert” and “Multipoint”.

insertar-elementos-de-dibujo.img/menuMultipunto_es.png

You can use the multipoint tool to create a drawing made up of a series of points which function as a single feature (i.e. we only need to select one of the points for the rest to also be selected). You need to bear in mind that this is not thus a points layer but a multipoint layer.

To insert a multipoint in the graphic area, select the tool and place the cursor over the part of the graphic area you wish to place the point. Left click on the mouse to insert the point. Repeat this step as many times as you wish. When you have finished adding points, right click on the mouse. A contextual menu will appear. Click on “End” to finish the new multipoint feature.

insertar-elementos-de-dibujo.img/menuContextualMultipunto2_es.png

You can create a multipoint feature from the command console. To do so, write the command “multipoint”. Input the coordinates of each point you wish to add in the console and press “Enter”. To finish the insertion of the new multipoint feature, write the command “E”.

insertar-elementos-de-dibujo.img/multipuntoEnConsola_es.png

Line

This command allows you to draw a line feature, which is actually a straight line segment. This feature is limited by its initial and final points. The final point may be the start of the next segment. When the first point has been inserted an elastic line appears on the display. You can use the mouse to determine where you wish the final point to go. As with the rest of the editing tools, there are three ways to access line creation. You can go to the edition tool bar and click on the “Line” button

insertar-elementos-de-dibujo.img/botonLinea_es.png

or go to the “Geometry” menu bar then to “Insert” and “Line”.

insertar-elementos-de-dibujo.img/menuLines_es.png

Place the cursor inside the graphic area and insert the line vertices in the desired points. gvSIG will create a projection from the last inserted point to the mouse pointer which you can use as a reference point to set the points in the drawing. You can also draw a line from the command console. Write the command “line” and then input the coordinates to define the points which delimit the segments which make up the line.

You can also insert the second and/or successive points by defining a distance and an angle. For example, to insert a point 1 unit away from the previous point at a 45º angle, write 1<45. The following image shows how a third point is inserted, after inserting the first and second points, one unit away from the previous point at a 180º angle.

insertar-elementos-de-dibujo.img/lineaDesdeConsola_es.png

Arc

You can draw an arc by clicking on the “Arc” button in the tool bar

insertar-elementos-de-dibujo.img/botonArco_es.png

or by going to the “Geometry” menu bar then to “Insert” and “Arc”.

insertar-elementos-de-dibujo.img/menuArco_es.png

Three points are requested to draw an arc. The first and last points mark the initial and final points of the arc and the second one marks an intermediate point through which the hypothetic circle of which the arc is a part would pass. To insert an arc from the command console, write the command “arc”. The three points required to define the arc will be requested one after another.

insertar-elementos-de-dibujo.img/arcoDesdeConsola_es.png

Polyline

This feature can be a set of arcs and/or segments combined by the user. You can draw a polyline by selecting the tool from the edition tool bar and clicking on the “Polyline” button

insertar-elementos-de-dibujo.img/botonPolilinea_es.png

or by going to the “Geometry” menu bar then to “Insert” and “Polyline”.

insertar-elementos-de-dibujo.img/menuPolilinea_es.png

The polyline allows you to insert straight lines in the graphic area, but these differ from standard lines in that they allow you to insert an arc from the last vertex, to which it will always be located at a tangent, and end the polyline thus creating a polygon. Click on the graphic area in the place you wish the first point of the polyline to be located and insert the following points by left clicking on the mouse in the places you wish to locate them. If you wish to draw an arc, right click on the mouse and select the “Internal arc” option in the contextual menu.

insertar-elementos-de-dibujo.img/menuContextualArcoInterno_es.png

When this option has been selected, gvSIG shows a projection of an arc from the last inserted vertex to the mouse pointer.

insertar-elementos-de-dibujo.img/arcoInternoDibujado_es.png

If you wish to insert more lines, go back to the contextual menu and select the “Internal line” option.

If you wish to close the figure so that a straight line is drawn from the last inserted point to the first point, select the “Close polyline” option.

To draw a polyline from the command console, write the command “polyline”. Input the coordinates of the source point. Then you can insert the second point or input one of the parameters to draw an arc “A”, or close the polyline “C”. When you have selected the arc option, you can draw more straight lines using the parameter “N”. The following image shows how the polyline draws a straight line from the arc's last vertex to the source, thus creating a closed figure after inputting the parameter “C”.

insertar-elementos-de-dibujo.img/polilineaDesdeConsola_es.png

Polygon

This option allows you to draw regular polygons which will be handled as a closed polyline. As usual, there are three ways of activating the polygon command. You can select this tool by going to the tool bar and clicking on the "Polygon" button.

insertar-elementos-de-dibujo.img/botonPoligono_es.png

The second option way of activating the tool is by going to the “Geometry” menu bar then to “Insert” and “Polygon”.

insertar-elementos-de-dibujo.img/menuPoligono_es.png

To graphically insert a polygon in the drawing, select the tool and then click inside the graphic area on the place you which to position the polygon’s central point.

The application will generate a projection of the object. Move the mouse using the polygon projection as a reference point until it is the size you require, and click on the graphic area once again.

You can tell gvSIG if you wish the polygon you are drawing to be defined as inscribed or circumscribed in the circle. By default, the polygon will be inscribed in the circle. To modify this setting, define the central point of the polygon, right click on the mouse to open the contextual menu and select the desired option.

insertar-elementos-de-dibujo.img/poligonoMenuContextual_es.png

gvSIG also allows you to modify the number of sides you wish the polygon you are editing to have. To do so, select the polygon object and input the number of sides in the command console.

insertar-elementos-de-dibujo.img/polilineaDesdeConsola_es.png

The third way to select this tool is from the command console. To draw a polygon from the command console, write the command “polygon”, specify the number of sides you wish the polygon to have, whether it should be drawn as inscribed or circumscribed (“I” or “C” respectively), and finally insert the radius, which must be delimited by indicating its length in the units in which the view is defined.


Rectangle

This allows you to draw a rectangle by indicating its diagonally opposite vertices. Click on the “Rectangle” button in the tool bar.

insertar-elementos-de-dibujo.img/botonRectangulo_es.png

You can also select the tool by going to the “Geometry” menu bar then to “Insert” and “Rectangle”.

insertar-elementos-de-dibujo.img/menuRectangulo_es.png

To graphically draw a rectangle in the layer you are editing, select the tool and place the first vertex in the required position in the graphic area. The application will show a projection of the rectangle you are drawing. Move the mouse, choose the position for the vertex diagonally opposite the one you have already inserted and left click on the mouse to define it.

insertar-elementos-de-dibujo.img/rectanguloDibujo_es.png

To work with the command console write the command “rectangle” and then input the coordinates for the first vertex and the diagonally opposite vertex.

insertar-elementos-de-dibujo.img/rectangulEnConsola_es.png

Square

A square is simply a rectangle with equal sides. To prevent possible mistakes when drawing the square, the application allows you to create a square based on a rectangle and makes it have equal sides. To draw a square, first select “Rectangle” and insert the first vertex, then right click on the mouse and click on the “Square” option (“Corner”) in the contextual menu.

insertar-elementos-de-dibujo.img/rectanguloMenuContextual_es.png

The following figure shows an example of the creation of a square from the command console. After the first point of the rectangle has been input, gvSIG is told to make the figure become a square by inputting the letter “C”. You can then insert the opposite corner.

insertar-elementos-de-dibujo.img/cuadradoEnConsola_es.png

If you make a mistake in inputting the coordinates the application will still draw a square by calculating the size of the vertical line (Y axis), using the coordinate specified for the X axis.


Circle

This command draws a circle inside the graphic area. You can select this tool by clicking on the “Circle” button in the tool bar

insertar-elementos-de-dibujo.img/botonCirculo_es.png

or by going to the “Geometry” menu bar then to “Insert” and “Circle”, as shown in the figure below.

insertar-elementos-de-dibujo.img/menuCirculo_es.png

There are two ways of defining a circle. The first option is to define the central point and the radius. Select the “Circle” tool and click on the graphic area in the place you wish to locate the centre of the circle you are drawing. Then move the mouse to increase the radius of the circle until it reaches the required size. gvSIG will, as always, create a projection of the circle as a reference point to show the position of the circle in the drawing. The second way of drawing a circle in gvSIG is to define it by using three points. To access this option to define a circle, first select the tool and then go to the contextual menu by right clicking on the mouse in the graphic area.

insertar-elementos-de-dibujo.img/menuContextualCirculo_es.png

There is only one circle that goes through three given points. When you use this option an elastic circle appears. It is defined by these two points and the cursor until we define the third point, as shown in the figure below.

insertar-elementos-de-dibujo.img/circulo3p_es.png

You can also draw a circle from the command console using any of the methods described above for graphic drawing. Write the command “circle” in the command console and press “Enter”. Insert the coordinates of the central point and then the coordinates of the point that will mark the desired radius or length (use the status bar to check whether you are working in metres or another measuring unit).

insertar-elementos-de-dibujo.img/circuloDesdeConsola_es.png

To insert a circle from the command console by defining three points, write “3p” when the “circle” command has been activated. When you use this option an elastic circle appears. It is defined by these two points and the cursor until we define the third point, as with the case of the graphic drawing of the circle. The figure below shows how to create a three-point circle.

insertar-elementos-de-dibujo.img/circulo3pEnConsola_es.png

Ellipse

An ellipse is defined by an axis and the length of the second axis to the centre of the ellipse. There are, as always, three ways of selecting the ellipse drawing tool. To graphically draw an ellipse you can click on the “Ellipse” button in the edition tool bar.

insertar-elementos-de-dibujo.img/botonElipse_es.png

The second option is by going to the “Geometry” menu bar then to “Insert” and “Ellipse”.

insertar-elementos-de-dibujo.img/menuElipse_es.png

To graphically draw an ellipse, indicate the initial and final points of the ellipse’s axis by left clicking on the mouse in the corresponding places. When the initial point has been input an elastic line will be shown which can be used as a reference point to mark the final point of the axis. When it has been set the ellipse projection will be shown until the third point which marks the distance to the other axis is defined.

insertar-elementos-de-dibujo.img/ElipseDibujandose_es.png

To draw an ellipse from the command console, write the command "ellipse". When gvSIG requests the initial point of the ellipse axis, indicate the point coordinates. It will then request the final point of the axis and finally the distance to the other axis.

insertar-elementos-de-dibujo.img/elipseDesdeConsola_es.png

Autopolygon

This tool is useful for drawing polygons adjacent to existing ones, thus avoiding having to digitise all the vertices along the common boundary between the polygons.

Therefore it it only necessary to digitise the new sides of the polygon; the tool will automatically generate the common boundaries.

Apart from saving digitising or drawing time, this tool also eliminates overlaps and gaps between two polygons sharing a common boundary.

To use the tool first start editing the layer you wish to work with, and then activate the Autocomplete polygons icon icon.

autocompletar-poligonos_en.img/auto-en.png/

Example of use of the tool

The new polygon can now be drawn without having to digitise the nodes of common boundaries, as shown in the figure below.

autocompletar-poligonos_en.img/auto2-en.png

Example of use of the tool

Once all sides have been drawn, double-click the mouse or press "E" (end) to terminate the polygon. The figure below shows how the new polygon has been clipped to the common boundaries of the existing polygons.

autocompletar-poligonos_en.img/auto3-en.png

Example of use of the tool


Creating a new layer

Introduction

gvSIG can create a new layer in the following formats: shp, dxf and postgis.

The tool can be accessed from the “View / New Layer” menu.

crear-nuevo-shp-en.img/menuNuevacapa_es.png

Creating a new SHP file

Select the “New SHP” option opens the wizard which will help you create the new layer.

crear-nuevo-shp-en.img/PrimeraVentanaCrearShp_es.png

The first window of the wizard allows you to choose the name you wish the new .shp file to appear with in the ToC, in addition to the geometry type associated with it.

crear-nuevo-shp-en.img/segundaVentanacrearShp_es.png

The second window of the wizard allows you to add all the fields you wish to the attribute table associated with the layer and to define some of the properties of these fields.

To add fields to the table, click on “Add field”. One field is added every time you click on this button.

If you wish to delete any of the fields created, simply select the field and click on the “Delete Field” button. You can edit the rest of the properties from the attribute table in which the fields are defined.

Field name: Place the cursor over the field name (“New field” by default) and write the new name. The maximum number of characters allowed for the field name is 10.

Field type: Place the cursor over any of the files in the “Type” field. A pull-down menu appears in which the type of field you wish to create can be selected.
  • BOOLEAN: Boolean type data admits “true” or “false” values.
  • DATE: This allows you to create a field which includes dates. The maximum number of characters allowed is 8.
  • INTEGER and DOUBLE are two number type fields. The former is for whole numbers and the latter for decimal values.
  • STRING: This is an alphanumeric field type. The maximum number of characters allowed is 254.

Field length: This allows you to set the maximum number of characters for the field created (at present, this only applies to String-type fields).

Once the structure of the table associated with the shape file has been determined, click on “Next”.

crear-nuevo-shp-en.img/ventanaIntroducirRutaFichero_es.png

You can save the file in the new window and choose the Reference System for the view the new layer is going to be inserted into by clicking on the button to the right of “Current Projection”.

crear-nuevo-shp-en.img/sistemasDeReferencia_es.png

If other layers have been inserted in the view, this button will be disabled since the view already has a selected reference system.

To save the new layer, indicate the file path to save the file in the text box.

crear-nuevo-shp-en.img/GuardarCapa_es.png

You can also open the search dialogue box to select the file path the new shape file will be saved in. To do so, click on the button to the right of the text box. Write the name for the new layer (remember that this name will appear in the source file of the shape file and that it may be different to the name which appears in the ToC) and click on the “Save” button.

crear-nuevo-shp-en.img/NuevacapaEnToc_es.png

When you have finished creating a new SHP file, it will be added to the ToC.

In addition, the editing tools will be activated to allow you to create the elements of the new layer.


Creating a new dxf file

The procedure to create a new DXF file is similar to that used to create a new SHP file, as described in the previous section. This tool can be accessed from the “View/New layer/New dxf” menu.

nuevo-dxf-o-postgis-en.img/menuNuevoDXF_es.png

If this tool is selected, the wizard will open a window allowing you to select a path for the file which is going to create a reference system for the view.

nuevo-dxf-o-postgis-en.img/ventanaIntroducirRutaFichero_es.png

Creating a new PostGIS file

If you wish to create a new PostGIS file, go to the menu “View/New layer/New PostGIS”.

nuevo-dxf-o-postgis-en.img/VentanaNUevoPostGis_24_es.png

The initial steps to create a new PostGIS file are similar to those followed in the section on creating a new Shape file.

The difference lies in the way the new layer is saved, as this is entered into a PostGIS data base.

Fill in the fields which apply to your connection and click on “Finish”.

nuevo-dxf-o-postgis-en.img/VentanaNUevoPostGis_es.png

Alphanumeric editing

Introduction

A table is part of a data base. It is made up of rows or records and columns or fields which contain the alphanumeric information needed to characterise the elements (polygons, lines or points) which make up the theme maps, cartography in general and graphs. The rows represent elements or objects and the columns represent the variables or attributes associated with each element.

edicion-alfanumerica.img/tabla_es.png

In general terms, there are two types of tables; “internal” tables which are typical of an information layer and are found in the same file and “external” tables which can be added to a gvSIG project. Each element (point, line or polygon) of a layer only has one record in that layer’s table of attributes.


Editing session for an 'internal' table.

Open a “View” and add the layer you wish to work with.

Remember that to start an alphanumeric editing process in gvSIG, you must put the layer you are working with in editing mode. In order to do this, select the layer in the ToC, go to the “Layer” menu and select “Start edition”. Select the “See table of attributes” button

edicion-alfanumerica.img/botonVerTablaDeAtributos_es.png

or go to the “Layer” menu and select “See table of attributes”.

The table associated with the layer will be automatically added to the project.

If you go to the “Project Manager” and select the “Tables” type of document, you can check that the table shown in the view is included as a separate document in the project.

To finish the table editing session, go to the “Layer” menu and select “Finish edition”. When the session finishes a message appears asking if you would like to save the changes. Click on “Yes” to save all the changes made in the table.


Editing session for an 'external' table.

  1. Go to the gvSIG’s “Project Manager”, and select the “Tables” type of document.
  2. Click on “New”.
  3. Click on “Add” and open the table you wish to edit.
  4. When you click on “Open” the table is displayed automatically on the screen.
  5. Go to the “Table” menu and select “Start edition”.
edicion-alfanumerica.img/tablaComenzarEdicion_es.png

Managing fields

This tool allows you to add, delete or rename fields. To access this tool, go to the “Table” menu and select “Manage fields”.

(An error occurs when you try to change the structure of a table hosted in a postgresql data base above version 7.4. To modify the structure, use a suitable data base manager).

edicion-alfanumerica.img/modificarEstructuraTabla_es.png

When the menu option is selected, a window appears in which the fields of the selected table and the buttons to create a new field or delete or rename an existing field are included.

edicion-alfanumerica.img/editorDeCampos_es.png

If you click on “New field”, a new window appears in which some of the properties of the new field to be added to the table can be configured.

edicion-alfanumerica.img/porpiedadesCampoNuevo_es.png

Field name: Enter the name of the new field. Type: If you click on the arrow on the right, a pull-down menu appears in which the type of field data (string, double...) can be configured.

Length: Indicate the required length of the field. (The max. length of a string field is 254 charecters).

Precision: Indicates the number of decimals a numerical field must have (only for numerical type fields).

Default value: Indicates the default value for the field when no specific value is defined in the table.

If you wish to use the delete tool (“Delete field”) and the renaming tool (“Rename field”), simply select the field to be modified and click on the corresponding button.


Editing a layer's table of attributes

Adding a record

To add a new record to a table associated with a layer, a graphic element must be inserted. When an element is added to the associated table a new blank record appears.

edicion-alfanumerica.img/tablaAnyadirRegistro_es.png

Enter the data for the new entity and press “Enter”.

N.B.: Remember that if you wish to delete the selection, you can go to the tool bar and click on “Clear selection” or you can use the menu bar by clicking on the “Layer” menu and then on “Clear selection”.

edicion-alfanumerica.img/botonBorrarSeleccion_es.png

N.B.: You can create a new layer with the elements selected in the table if you wish. To do so, close the table, go to the menu bar and click on the “Layer” option and then on “Export to ...”. Then select the format you wish to create the new layer with.


Modifying a record

To modify the data of a layer element saved in the table, select the element whose data you wish to modify. The record that corresponds to the selected graphic element is highlighted in yellow in the table of attributes.

edicion-alfanumerica.img/tablaRegistroSeleccionado_es.png

Left click on the cell in which the record to be modified is located. The record changes and a cursor appears to indicate that the data can be input.

edicion-alfanumerica.img/tablaRegistroModificado_es.png

Removing a record

To remove a record from the table, you must first select the record.

edicion-alfanumerica.img/tablaRegistroSeleccionado2_es.png

Go to the “Table” menu and select “Remove row”.

edicion-alfanumerica.img/tablaMenuEliminarFila_es.png

The selected record is deleted from the table and the associated graphic element disappears from the view.

edicion-alfanumerica.img/tablaRegistroEliminado_es.png

Field Calculator

Introduction

gvSIG’s field calculator allows you to perform different types of calculations on the fields of a table (for example calculate areas, perimeters, convert the data in a field from degrees to radians, etc).


Accessing gvSIG's field calculator

To access the field calculator, you must first start an editing session in gvSIG. If you wish to activate the edition of a layer loaded in a view, go to the layer’s contextual menu and select “Start edition”.

calculadora-de-campos/calculadora-de-campos-en.img/menuComenzarEdicion_es.png

If you wish to edit a recently-loaded table, go to the “Table” menu and select “Start edition”.

calculadora-de-campos/calculadora-de-campos-en.img/tablaComenzarEdicion_es.png

If you decide to use the field calculator on a “New layer” (for example New shp) which you are going to create (remember that to access this option you must go to the “View” menu and select the “New layer” option), the layer will automatically appear in editing mode when inserted in the view.

calculadora-de-campos/calculadora-de-campos-en.img/menuNuevacapa_es.png

Once you have started an editing session, activate the table of attributes on which the operations are going to be performed and select one of the fields (by clicking on the field heading). The following button will then be activated in the tool bar:

calculadora-de-campos/calculadora-de-campos-en.img/botonCalculadoraCampos_es.png

This will allow you to access the field calculator.

NB. The first time you open the field calculator in a new gvSIG session, a warning window appears to inform you that the calculator is “Loading operators”. Once this process has finished, the window which allows you to perform operations with the various fields appears.


Introduction example

“Field calculator” Let us look at a simple example to explain how the field calculator works.

In order to work out the area of a series of plots in a layer we have created:

First, open a gvSIG view and load an orthophoto which will be used as a base to determine the location of the plots. Next, select the tool in order to create a new shp file (View/New layer/SHP).

Select a “Polygon” type layer, click on the “Next” option and then create a “Double” type field called “Area”, leaving the default value at 20.

calculadora-de-campos/calculadora-de-campos-en.img/NuevaCapaAnyadirCampos_es.png

Draw four plots on the orthophoto using the “Insert polyline” tool selected from the tool bar. The image below shows that a record for each of the plots has been created in the table.

tablas/calculadora-de-campos/calculadora-de-campos-en.img/parcelasDigitalizadas_es.png

Select the field from the table and activate the field calculator.

tablas/calculadora-de-campos/calculadora-de-campos-en.img/botonCalculadoraCampos_es.png
calculadora-de-campos-en.img/ventanaCalculadoraCampos_es.png

The following information appears in the “General” tab:

calculadora-de-campos-en.img/CampoTipoComandosCalculadoraCampos_es.png

“Field”. This contains the various different fields which comprise the table being worked on.

“Type” of field selected. Access to different commands depends on the type of field.

“Commands” which can be used in the calculations.

The “Information” section shows that:

If the “area” command has been selected in the “General” tab, a brief description will be displayed in the information window.

calculadora-de-campos-en.img/informacionValorBoleano_es.png

If the “area” command has been selected in the “General” tab, the information window returns a message with information on the field type (remember that when designing the “area” shape, a Double type numeric field was created in which the area will be calculated).

calculadora-de-campos-en.img/informacionCalculadoraCampos_es.png

The “Expression" area displays the name of the column on which the calculation is being performed and a text box for the calculation sentence to be used.

calculadora-de-campos-en.img/informacionAreaCalculadoraCampos_es.png

In this case, the sentence included in the expression section is simple (no parameters are required as they are in other expressions which shall be explained later on).

To sum up and conclude this example, once the “area” command has been selected, click on “Ok” and the field created in the table will automatically be filled with the area values of each of the polygons drawn.

calculadora-de-campos-en.img/tablaResultadosArea_es.png

Description of the 'Field Calculator'
Introduction
tablas/calculadora-de-campos/calculadora-de-campos-en.img/ventanaCalculadoraCampos_es.png

The field calculator window has three different sections.


Information

The Information section provides information about the type of field and the commands selected in the “General” tab.

The following information can be found in this section:

tablas/calculadora-de-campos/calculadora-de-campos-en.img/informacionIsNumber_es.png

Example: In this case the command we wish to use is “log”, which allows us to calculate the logarithm of a field with a numerical value.

calculadora-de-campos-en.img/informacionLogaritmo_es.png

The “log (Parameter)” operator indicates that, for example, in order to obtain the logarithm of a field which contains the area data of a plot shp, the word “Parameter” must be replaced by the field we wish to obtain the logarithm of. As a result, the expression will be as follows: log([AREA])

calculadora-de-campos-en.img/expresionColumnaLogaritmo_es.png

NB. If a table field is selected in the “Field” section of the field calculator, the information window indicates what type of data it is.

NB. In order to input parameters into the “Expression” text box, either double click on the name of the field from the list of fields in the General tab or type in the name of the field, in which case the String expressions input must be placed in inverted commas.

calculadora-de-campos-en.img/InformacionCampoArea_es.png

Numerical Value = The result must be String, Double or integer type field data.

NB. If a String field type has been selected, it should be noted that this field type uses string values. If we add two String fields to another String field, the final result is a string and not the result of the operation (for example: 2+2 = 22, not 4).

Boolean Value = A Boolean value returns a true/false answer to a question. If the result of the question is in a numerical field, it would therefore be either “1/0” depending on whether the reply was true or false. Let us look at an example:

We wish to know if there are records in a field which are the same as those in another field. The command which allows us to find this out “==”

calculadora-de-campos-en.img/informacionValorBoleano_es.png

If we type the following sentence: [integer] == [double] (double and integer being the names of two fields, each with numerical values), the response according to the type of target field (Boolean or String) can be seen in the image below:

calculadora-de-campos-en.img/tablaConIntDouBooStr_es.png

NB. If a new layer is created in a gvSIG view (View menu / New layer), the wizard for this action allows you to specify the “Type of field” on which calculations are going to be performed.

calculadora-de-campos-en.img/NuevaCapaAnyadirCampos_es.png

If you are working with a layer and wish to know the field type, simply start a layer editing session, go to the “Table” menu and select “Manage fields”.

tablas/calculadora-de-campos/calculadora-de-campos-en.img/menuModificarEstructuraTabla_es.png

This opens a window called the “Field manager”, which allows the fields of a table to be created, renamed or deleted. It can also be used to confirm the field type.

tablas/calculadora-de-campos/calculadora-de-campos-en.img/editorCampos_es.png

General / Advanced Tabs
tablas/calculadora-de-campos/calculadora-de-campos-en.img/pestanyaAvanzada_es.png

Once the file has been selected, click on the “Evaluate” button to find out whether the expression is correct or not.

NB. The expressions must be written in Python programming language.


'Expression' Section

The name of the field the results of the calculations of the expressions entered in the text box appear in is next to the “Column” text.

NB. The expressions are only calculated on the records selected in the table (if no records have been selected, the calculation is performed on all the records in the selected field).


Introductory example: 'Field Calculator'

“Field calculator” Let us look at a simple example to explain how the field calculator works.

In order to work out the area of a series of plots in a layer we have created:

First, open a gvSIG view and load an orthophoto which will be used as a base to determine the location of the plots. Next, select the tool in order to create a new shp file (View/New layer/SHP).

Select a “Polygon” type layer, click on the “Next” option and then create a “Double” type field called “Area”, leaving the default value at 20.

calculadora-de-campos/calculadora-de-campos-en.img/NuevaCapaAnyadirCampos_es.png

Draw four plots on the orthophoto using the “Insert polyline” tool selected from the tool bar. The image below shows that a record for each of the plots has been created in the table.

tablas/calculadora-de-campos/calculadora-de-campos-en.img/parcelasDigitalizadas_es.png

Select the field from the table and activate the field calculator.

tablas/calculadora-de-campos/calculadora-de-campos-en.img/botonCalculadoraCampos_es.png
calculadora-de-campos-en.img/ventanaCalculadoraCampos_es.png

The following information appears in the “General” tab:

calculadora-de-campos-en.img/CampoTipoComandosCalculadoraCampos_es.png

“Field”. This contains the various different fields which comprise the table being worked on.

“Type” of field selected. Access to different commands depends on the type of field.

“Commands” which can be used in the calculations.

The “Information” section shows that:

If the “area” command has been selected in the “General” tab, a brief description will be displayed in the information window.

calculadora-de-campos-en.img/informacionValorBoleano_es.png

If the “area” command has been selected in the “General” tab, the information window returns a message with information on the field type (remember that when designing the “area” shape, a Double type numeric field was created in which the area will be calculated).

calculadora-de-campos-en.img/informacionCalculadoraCampos_es.png

The “Expression" area displays the name of the column on which the calculation is being performed and a text box for the calculation sentence to be used.

calculadora-de-campos-en.img/informacionAreaCalculadoraCampos_es.png

In this case, the sentence included in the expression section is simple (no parameters are required as they are in other expressions which shall be explained later on).

To sum up and conclude this example, once the “area” command has been selected, click on “Ok” and the field created in the table will automatically be filled with the area values of each of the polygons drawn.

calculadora-de-campos-en.img/tablaResultadosArea_es.png

Add consecutive numbers
Introduction

This functionality makes it easy to populate a field in a table with consecutive numbers by means of a mathematical function (REC) in the field calculator.


Enter row numbers in a field

This new functionality has been introduced to facilitate the task of filling a field in a table with consecutive numbers by means of a mathematical function in the field calculator.

This function is typically used for the "ID" field of a layer's geometries. To access it you need to activate edit mode for the layer and then open the table. Select the field (of type Integer) to which you want to add consecutive numbers and click on the field calculator.

numeros-consecutivos_en.img/calculadora_en.png

Calculator button

Select the numeric type option and then double-click the "rec" command, as shown in the figure below.

numeros-consecutivos_en.img/idconsecutivo_en.png

Rec function (consecutive numbering)

Once the process is complete the selected field in the table will be filled with consecutive numbers, starting with the number "0". Finish editing and save changes if desired.


Add geometric information to a layer

In gvSIG, the Add geometric info tool is available when there are visible vector layers in the active View.

Icons
Icon Description
habilit Add geometric info tool enabled if there are visible vector layers in the current view.
deshabilit Add geometric info tool disabled if there are no visible vector layers in the current view.

With this tool you can select which geometric properties to calculate for a visible vector layer in the current view, and then save these properties in the layer itself. The information can be saved in either new or existing fields in the layer's attribute table.

Once the above condition is met (i.e. a visible vector layer in the active View), the tool is available:

Via the menu: Layer → Add geometric info

agregar-informacion-geografica-a-la-capa_en.img/IGRutaMenu_en.png

Selecting the Add geometric info tool from the menu

Selecting the tool displays a dialog where the attributes to be added can be selected:

agregar-informacion-geografica-a-la-capa_en.img/IGAgregarInformacion_en.png

Add geometric information

1. Drop-down list for selecting vector layers. Lists the layers in the order that they appear in the TOC of the active view. The following information is shown:

2. Layer information writable. Indicates whether changes can be saved to the selected layer:

Icons
Icon Mode
iconosi Yes, changes can be saved. In this case the attributes to be added can be selected.
iconono No, changes can't be saved. The tool will not list any attributes.

3. List of geometric attributes. List of attributes of the geometry of the layer. These depend on the type of layer:

The geometric attribute will be associated with one type of geometry, which is identified by the icon on the left:

Icons
Icon Geometry type
punto The attribute is characteristic of point geometries.
multipunto The attribute is characteristic of multipoint geometries.
linea The attribute is characteristic of line geometries.
poligono The attribute is characteristic of polygon geometries.

4. Selection buttons. Allow attributes to be added to, or removed from, the list of geometry attributes to be calculated and saved for the vector layer.

Icons
Icon Option
deldel Add all the geometric attributes to the list.
del Add the selected geometric attributes to the list.
tras Remove the selected geometric attributes from the list.
trastras Remove all the geometric attributes from the list.

5. List of added geometric attributes. List of layer geometry attributes to be calculated and added.

Clicking on any of the attributes in this list enables the controls that allow the field to be renamed.

6. New field. This checkbox indicates whether the attribute is added as a new field, or as an update to an existing field in the vector layer.

info By default, every attribute is added as a new field.

7. Field name. New fields can have any name. Otherwise, select a field to update.

advert The length of the field names is limited.

advert1 It is possible that the layer's alphanumeric encoding does not support some characters of the current language.

8. Save field settings. If the checkbox field is changed, or if another field name is specified, the changes can be saved by pressing this button.

agregar-informacion-geografica-a-la-capa_en.img/IGAgregarInformacion2_en.png

Add geometric information

9. Reset. Resets the dialog by reloading the current View's visible vector layers, and by removing any selected attributes and their settings.

Once all the attributes have been selected, click the Ok button to start the process and display a progress bar.

Clicking the Cancel button, on the other hand, will terminate the tool.

agregar-informacion-geografica-a-la-capa_en.img/IGProcesoDeAgregacion_en.png

Progress of the Add geometric information process

  1. Progress bar: percentage of process completed.
  2. Show/Hide Details: show or hide the steps that have been completed.
  3. Cancel: Stops the process.

In the event of a serious problem, the process is terminated and an error message is displayed:

agregar-informacion-geografica-a-la-capa_en.img/ErrorProceso_en.png

Error message

If the process completes successfully, the Accept button is enabled and the tool can be closed.

It is possible to view the steps that were performed by clicking the Show Details button in the dialog:

agregar-informacion-geografica-a-la-capa_en.img/Proceso_en.png

List of steps performed in adding geometric information

advert2 Do not use the gvSIG interface while the process is in progress as this can produce inconsistent data states, and even errors.

advert3 It should be noted that gvSIG currently adds the areas and perimeters of islands to that of the surrounding geometry.

EXAMPLE

Following the steps described in paragraph 5:

agregar-informacion-geografica-a-la-capa_en.img/IGImagenTabla_en.png

Example showing the calculated geometric information


Import fields from one table to another

The "Import fields" tool is used to import fields from one table to another. Both tables must have a common field.

In order to access the tool from the Table / Import fields menu, first open the table into which the fields are to be imported.

importar-campos-de-una-tabla-a-otra_en.img/Ventana_en.png

Menu path to the tool

Clicking on "Import fields" opens the following dialog:

importar-campos-de-una-tabla-a-otra_en.img/Opcion1_en.png

Tool dialog

Follow these steps to perform the import:

Click the "Next" button and from the dialog shown below select the fields to import.

importar-campos-de-una-tabla-a-otra_en.img/Fin_en.png

Final step of the tool

Click on the "Finish" button and check that the imported fields have been added to the end of the active table.



-----------------------------------
  1. Se ha producido un error en el documento Scaling , accediendo a la imagen escalarPorReferenciaConsola_en.png, que probablemente no existe. No se han encontrado alternativas
  2. Se ha producido un error en el documento Matrix , accediendo a la imagen vector-en.png, que probablemente no existe. Se han encontrado las siguientas alternativas [1, ]

Cached time 11/22/13 01:38:31 Clear cache and reload